package com.virtualperson.dto;

import com.alibaba.dashscope.audio.tts.SpeechSynthesisAudioFormat;
import lombok.Data;
import lombok.Builder;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class TtsRequestDTO {
    
    @NotBlank(message = "文本内容不能为空")
    @Size(max = 10000, message = "文本长度不能超过10000个字符")
    private String text;
    
    private String model;
    
    private SpeechSynthesisAudioFormat format;
    
    @Min(value = 8000, message = "采样率不能低于8000Hz")
    @Max(value = 48000, message = "采样率不能高于48000Hz")
    private Integer sampleRate;
    
    @Min(value = 0, message = "音量不能小于0")
    @Max(value = 100, message = "音量不能大于100")
    private Integer volume;
    
    @Min(value = 5, message = "语速不能小于0.5")
    @Max(value = 20, message = "语速不能大于2.0")
    private Float rate;
    
    @Min(value = 5, message = "语调不能小于0.5")
    @Max(value = 20, message = "语调不能大于2.0")
    private Float pitch;
    
    private Boolean enableWordTimestamp;
    
    private Boolean enablePhonemeTimestamp;
    
    private Boolean streamMode = false; // 是否使用流式调用
} 